<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-pragma">{-# LANGUAGE CPP #-}</span><span>
</span><span id="line-2"></span><span>
</span><span id="line-3"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">GHC.Stg.DepAnal</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Stg.DepAnal.html#depSortStgPgm"><span class="hs-identifier">depSortStgPgm</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-4"></span><span>
</span><span id="line-5"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Prelude.html"><span class="hs-identifier">GHC.Prelude</span></a></span><span>
</span><span id="line-6"></span><span>
</span><span id="line-7"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Stg.Syntax.html"><span class="hs-identifier">GHC.Stg.Syntax</span></a></span><span>
</span><span id="line-8"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Id.html"><span class="hs-identifier">GHC.Types.Id</span></a></span><span>
</span><span id="line-9"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Name.html"><span class="hs-identifier">GHC.Types.Name</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier">Name</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Name.html#nameIsLocalOrFrom"><span class="hs-identifier">nameIsLocalOrFrom</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-10"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Name.Env.html"><span class="hs-identifier">GHC.Types.Name.Env</span></a></span><span>
</span><span id="line-11"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html"><span class="hs-identifier">GHC.Utils.Outputable</span></a></span><span>
</span><span id="line-12"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Unique.Set.html"><span class="hs-identifier">GHC.Types.Unique.Set</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Unique.Set.html#nonDetEltsUniqSet"><span class="hs-identifier">nonDetEltsUniqSet</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-13"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Var.Set.html"><span class="hs-identifier">GHC.Types.Var.Set</span></a></span><span>
</span><span id="line-14"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Unit.Module.html"><span class="hs-identifier">GHC.Unit.Module</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Unit.Types.html#Module"><span class="hs-identifier">Module</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-15"></span><span>
</span><span id="line-16"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../containers/src/Data.Graph.html#"><span class="hs-identifier">Data.Graph</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../containers/src/Data.Graph.html#SCC"><span class="hs-identifier">SCC</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-17"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.Bifunctor.html#"><span class="hs-identifier">Data.Bifunctor</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Data.Bifunctor.html#first"><span class="hs-identifier">first</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-18"></span><span>
</span><span id="line-19"></span><span class="hs-comment">--------------------------------------------------------------------------------</span><span>
</span><span id="line-20"></span><span class="hs-comment">-- * Dependency analysis</span><span>
</span><span id="line-21"></span><span>
</span><span id="line-22"></span><span class="hs-comment">-- | Set of bound variables</span><span>
</span><span id="line-23"></span><span class="hs-keyword">type</span><span> </span><span id="BVs"><span class="annot"><a href="GHC.Stg.DepAnal.html#BVs"><span class="hs-identifier hs-var">BVs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.Types.Var.Set.html#VarSet"><span class="hs-identifier hs-type">VarSet</span></a></span><span>
</span><span id="line-24"></span><span>
</span><span id="line-25"></span><span class="hs-comment">-- | Set of free variables</span><span>
</span><span id="line-26"></span><span class="hs-keyword">type</span><span> </span><span id="FVs"><span class="annot"><a href="GHC.Stg.DepAnal.html#FVs"><span class="hs-identifier hs-var">FVs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.Types.Var.Set.html#VarSet"><span class="hs-identifier hs-type">VarSet</span></a></span><span>
</span><span id="line-27"></span><span>
</span><span id="line-28"></span><span class="hs-comment">-- | Dependency analysis on STG terms.</span><span>
</span><span id="line-29"></span><span class="hs-comment">--</span><span>
</span><span id="line-30"></span><span class="hs-comment">-- Dependencies of a binding are just free variables in the binding. This</span><span>
</span><span id="line-31"></span><span class="hs-comment">-- includes imported ids and ids in the current module. For recursive groups we</span><span>
</span><span id="line-32"></span><span class="hs-comment">-- just return one set of free variables which is just the union of dependencies</span><span>
</span><span id="line-33"></span><span class="hs-comment">-- of all bindings in the group.</span><span>
</span><span id="line-34"></span><span class="hs-comment">--</span><span>
</span><span id="line-35"></span><span class="hs-comment">-- Implementation: pass bound variables (BVs) to recursive calls, get free</span><span>
</span><span id="line-36"></span><span class="hs-comment">-- variables (FVs) back. We ignore imported FVs as they do not change the</span><span>
</span><span id="line-37"></span><span class="hs-comment">-- ordering but it improves performance.</span><span>
</span><span id="line-38"></span><span class="hs-comment">--</span><span>
</span><span id="line-39"></span><span class="annot"><a href="GHC.Stg.DepAnal.html#annTopBindingsDeps"><span class="hs-identifier hs-type">annTopBindingsDeps</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Unit.Types.html#Module"><span class="hs-identifier hs-type">Module</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Stg.Syntax.html#StgTopBinding"><span class="hs-identifier hs-type">StgTopBinding</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Stg.Syntax.html#StgTopBinding"><span class="hs-identifier hs-type">StgTopBinding</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Stg.DepAnal.html#FVs"><span class="hs-identifier hs-type">FVs</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-40"></span><span id="annTopBindingsDeps"><span class="annot"><span class="annottext">annTopBindingsDeps :: Module -&gt; [StgTopBinding] -&gt; [(StgTopBinding, FVs)]
</span><a href="GHC.Stg.DepAnal.html#annTopBindingsDeps"><span class="hs-identifier hs-var hs-var">annTopBindingsDeps</span></a></span></span><span> </span><span id="local-6989586621680955253"><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621680955253"><span class="hs-identifier hs-var">this_mod</span></a></span></span><span> </span><span id="local-6989586621680955252"><span class="annot"><span class="annottext">[StgTopBinding]
</span><a href="#local-6989586621680955252"><span class="hs-identifier hs-var">bs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[StgTopBinding] -&gt; [FVs] -&gt; [(StgTopBinding, FVs)]
forall a b. [a] -&gt; [b] -&gt; [(a, b)]
</span><a href="../../base/src/GHC.List.html#zip"><span class="hs-identifier hs-var">zip</span></a></span><span> </span><span class="annot"><span class="annottext">[StgTopBinding]
</span><a href="#local-6989586621680955252"><span class="hs-identifier hs-var">bs</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(StgTopBinding -&gt; FVs) -&gt; [StgTopBinding] -&gt; [FVs]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">StgTopBinding -&gt; FVs
</span><a href="#local-6989586621680955251"><span class="hs-identifier hs-var">top_bind</span></a></span><span> </span><span class="annot"><span class="annottext">[StgTopBinding]
</span><a href="#local-6989586621680955252"><span class="hs-identifier hs-var">bs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-41"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-42"></span><span>    </span><span class="annot"><a href="#local-6989586621680955251"><span class="hs-identifier hs-type">top_bind</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Stg.Syntax.html#StgTopBinding"><span class="hs-identifier hs-type">StgTopBinding</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Stg.DepAnal.html#FVs"><span class="hs-identifier hs-type">FVs</span></a></span><span>
</span><span id="line-43"></span><span>    </span><span id="local-6989586621680955251"><span class="annot"><span class="annottext">top_bind :: StgTopBinding -&gt; FVs
</span><a href="#local-6989586621680955251"><span class="hs-identifier hs-var hs-var">top_bind</span></a></span></span><span> </span><span class="annot"><a href="GHC.Stg.Syntax.html#StgTopStringLit"><span class="hs-identifier hs-type">StgTopStringLit</span></a></span><span class="hs-special">{</span><span class="hs-special">}</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-44"></span><span>      </span><span class="annot"><span class="annottext">FVs
</span><a href="GHC.Types.Var.Set.html#emptyVarSet"><span class="hs-identifier hs-var">emptyVarSet</span></a></span><span>
</span><span id="line-45"></span><span>
</span><span id="line-46"></span><span>    </span><span class="annot"><a href="#local-6989586621680955251"><span class="hs-identifier hs-var">top_bind</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Stg.Syntax.html#StgTopLifted"><span class="hs-identifier hs-type">StgTopLifted</span></a></span><span> </span><span id="local-6989586621680955247"><span class="annot"><span class="annottext">GenStgBinding 'Vanilla
</span><a href="#local-6989586621680955247"><span class="hs-identifier hs-var">bs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-47"></span><span>      </span><span class="annot"><span class="annottext">FVs -&gt; GenStgBinding 'Vanilla -&gt; FVs
</span><a href="#local-6989586621680955246"><span class="hs-identifier hs-var">binding</span></a></span><span> </span><span class="annot"><span class="annottext">FVs
</span><a href="GHC.Types.Var.Set.html#emptyVarSet"><span class="hs-identifier hs-var">emptyVarSet</span></a></span><span> </span><span class="annot"><span class="annottext">GenStgBinding 'Vanilla
</span><a href="#local-6989586621680955247"><span class="hs-identifier hs-var">bs</span></a></span><span>
</span><span id="line-48"></span><span>
</span><span id="line-49"></span><span>    </span><span class="annot"><a href="#local-6989586621680955246"><span class="hs-identifier hs-type">binding</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Stg.DepAnal.html#BVs"><span class="hs-identifier hs-type">BVs</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Stg.Syntax.html#StgBinding"><span class="hs-identifier hs-type">StgBinding</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Stg.DepAnal.html#FVs"><span class="hs-identifier hs-type">FVs</span></a></span><span>
</span><span id="line-50"></span><span>    </span><span id="local-6989586621680955246"><span class="annot"><span class="annottext">binding :: FVs -&gt; GenStgBinding 'Vanilla -&gt; FVs
</span><a href="#local-6989586621680955246"><span class="hs-identifier hs-var hs-var">binding</span></a></span></span><span> </span><span id="local-6989586621680955244"><span class="annot"><span class="annottext">FVs
</span><a href="#local-6989586621680955244"><span class="hs-identifier hs-var">bounds</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Stg.Syntax.html#StgNonRec"><span class="hs-identifier hs-type">StgNonRec</span></a></span><span> </span><span class="annot"><span class="annottext">BinderP 'Vanilla
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621680955242"><span class="annot"><span class="annottext">GenStgRhs 'Vanilla
</span><a href="#local-6989586621680955242"><span class="hs-identifier hs-var">r</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-51"></span><span>      </span><span class="annot"><span class="annottext">FVs -&gt; GenStgRhs 'Vanilla -&gt; FVs
</span><a href="#local-6989586621680955241"><span class="hs-identifier hs-var">rhs</span></a></span><span> </span><span class="annot"><span class="annottext">FVs
</span><a href="#local-6989586621680955244"><span class="hs-identifier hs-var">bounds</span></a></span><span> </span><span class="annot"><span class="annottext">GenStgRhs 'Vanilla
</span><a href="#local-6989586621680955242"><span class="hs-identifier hs-var">r</span></a></span><span>
</span><span id="line-52"></span><span>    </span><span class="annot"><a href="#local-6989586621680955246"><span class="hs-identifier hs-var">binding</span></a></span><span> </span><span id="local-6989586621680955240"><span class="annot"><span class="annottext">FVs
</span><a href="#local-6989586621680955240"><span class="hs-identifier hs-var">bounds</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Stg.Syntax.html#StgRec"><span class="hs-identifier hs-type">StgRec</span></a></span><span> </span><span id="local-6989586621680955238"><span class="annot"><span class="annottext">[(BinderP 'Vanilla, GenStgRhs 'Vanilla)]
</span><a href="#local-6989586621680955238"><span class="hs-identifier hs-var">bndrs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-53"></span><span>      </span><span class="annot"><span class="annottext">[FVs] -&gt; FVs
</span><a href="GHC.Types.Var.Set.html#unionVarSets"><span class="hs-identifier hs-var">unionVarSets</span></a></span><span> </span><span class="annot"><span class="annottext">([FVs] -&gt; FVs) -&gt; [FVs] -&gt; FVs
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-54"></span><span>        </span><span class="annot"><span class="annottext">((Id, GenStgRhs 'Vanilla) -&gt; FVs)
-&gt; [(Id, GenStgRhs 'Vanilla)] -&gt; [FVs]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FVs -&gt; (Id, GenStgRhs 'Vanilla) -&gt; FVs
</span><a href="#local-6989586621680955236"><span class="hs-identifier hs-var">bind_non_rec</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FVs -&gt; [Id] -&gt; FVs
</span><a href="GHC.Types.Var.Set.html#extendVarSetList"><span class="hs-identifier hs-var">extendVarSetList</span></a></span><span> </span><span class="annot"><span class="annottext">FVs
</span><a href="#local-6989586621680955240"><span class="hs-identifier hs-var">bounds</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">((Id, GenStgRhs 'Vanilla) -&gt; Id)
-&gt; [(Id, GenStgRhs 'Vanilla)] -&gt; [Id]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">(Id, GenStgRhs 'Vanilla) -&gt; Id
forall a b. (a, b) -&gt; a
</span><a href="../../base/src/Data.Tuple.html#fst"><span class="hs-identifier hs-var">fst</span></a></span><span> </span><span class="annot"><span class="annottext">[(Id, GenStgRhs 'Vanilla)]
[(BinderP 'Vanilla, GenStgRhs 'Vanilla)]
</span><a href="#local-6989586621680955238"><span class="hs-identifier hs-var">bndrs</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[(Id, GenStgRhs 'Vanilla)]
[(BinderP 'Vanilla, GenStgRhs 'Vanilla)]
</span><a href="#local-6989586621680955238"><span class="hs-identifier hs-var">bndrs</span></a></span><span>
</span><span id="line-55"></span><span>
</span><span id="line-56"></span><span>    </span><span class="annot"><a href="#local-6989586621680955236"><span class="hs-identifier hs-type">bind_non_rec</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Stg.DepAnal.html#BVs"><span class="hs-identifier hs-type">BVs</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Stg.Syntax.html#StgRhs"><span class="hs-identifier hs-type">StgRhs</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Stg.DepAnal.html#FVs"><span class="hs-identifier hs-type">FVs</span></a></span><span>
</span><span id="line-57"></span><span>    </span><span id="local-6989586621680955236"><span class="annot"><span class="annottext">bind_non_rec :: FVs -&gt; (Id, GenStgRhs 'Vanilla) -&gt; FVs
</span><a href="#local-6989586621680955236"><span class="hs-identifier hs-var hs-var">bind_non_rec</span></a></span></span><span> </span><span id="local-6989586621680955233"><span class="annot"><span class="annottext">FVs
</span><a href="#local-6989586621680955233"><span class="hs-identifier hs-var">bounds</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680955232"><span class="annot"><span class="annottext">GenStgRhs 'Vanilla
</span><a href="#local-6989586621680955232"><span class="hs-identifier hs-var">r</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-58"></span><span>        </span><span class="annot"><span class="annottext">FVs -&gt; GenStgRhs 'Vanilla -&gt; FVs
</span><a href="#local-6989586621680955241"><span class="hs-identifier hs-var">rhs</span></a></span><span> </span><span class="annot"><span class="annottext">FVs
</span><a href="#local-6989586621680955233"><span class="hs-identifier hs-var">bounds</span></a></span><span> </span><span class="annot"><span class="annottext">GenStgRhs 'Vanilla
</span><a href="#local-6989586621680955232"><span class="hs-identifier hs-var">r</span></a></span><span>
</span><span id="line-59"></span><span>
</span><span id="line-60"></span><span>    </span><span class="annot"><a href="#local-6989586621680955241"><span class="hs-identifier hs-type">rhs</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Stg.DepAnal.html#BVs"><span class="hs-identifier hs-type">BVs</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Stg.Syntax.html#StgRhs"><span class="hs-identifier hs-type">StgRhs</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Stg.DepAnal.html#FVs"><span class="hs-identifier hs-type">FVs</span></a></span><span>
</span><span id="line-61"></span><span>    </span><span id="local-6989586621680955241"><span class="annot"><span class="annottext">rhs :: FVs -&gt; GenStgRhs 'Vanilla -&gt; FVs
</span><a href="#local-6989586621680955241"><span class="hs-identifier hs-var hs-var">rhs</span></a></span></span><span> </span><span id="local-6989586621680955231"><span class="annot"><span class="annottext">FVs
</span><a href="#local-6989586621680955231"><span class="hs-identifier hs-var">bounds</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Stg.Syntax.html#StgRhsClosure"><span class="hs-identifier hs-type">StgRhsClosure</span></a></span><span> </span><span class="annot"><span class="annottext">XRhsClosure 'Vanilla
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">CostCentreStack
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">UpdateFlag
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621680955229"><span class="annot"><span class="annottext">[BinderP 'Vanilla]
</span><a href="#local-6989586621680955229"><span class="hs-keyword hs-var">as</span></a></span></span><span> </span><span id="local-6989586621680955228"><span class="annot"><span class="annottext">GenStgExpr 'Vanilla
</span><a href="#local-6989586621680955228"><span class="hs-identifier hs-var">e</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-62"></span><span>      </span><span class="annot"><span class="annottext">FVs -&gt; GenStgExpr 'Vanilla -&gt; FVs
</span><a href="#local-6989586621680955227"><span class="hs-identifier hs-var">expr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FVs -&gt; [Id] -&gt; FVs
</span><a href="GHC.Types.Var.Set.html#extendVarSetList"><span class="hs-identifier hs-var">extendVarSetList</span></a></span><span> </span><span class="annot"><span class="annottext">FVs
</span><a href="#local-6989586621680955231"><span class="hs-identifier hs-var">bounds</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
[BinderP 'Vanilla]
</span><a href="#local-6989586621680955229"><span class="hs-keyword hs-var">as</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">GenStgExpr 'Vanilla
</span><a href="#local-6989586621680955228"><span class="hs-identifier hs-var">e</span></a></span><span>
</span><span id="line-63"></span><span>
</span><span id="line-64"></span><span>    </span><span class="annot"><a href="#local-6989586621680955241"><span class="hs-identifier hs-var">rhs</span></a></span><span> </span><span id="local-6989586621680955226"><span class="annot"><span class="annottext">FVs
</span><a href="#local-6989586621680955226"><span class="hs-identifier hs-var">bounds</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Stg.Syntax.html#StgRhsCon"><span class="hs-identifier hs-type">StgRhsCon</span></a></span><span> </span><span class="annot"><span class="annottext">CostCentreStack
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">DataCon
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621680955224"><span class="annot"><span class="annottext">[StgArg]
</span><a href="#local-6989586621680955224"><span class="hs-keyword hs-var">as</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-65"></span><span>      </span><span class="annot"><span class="annottext">FVs -&gt; [StgArg] -&gt; FVs
</span><a href="#local-6989586621680955223"><span class="hs-identifier hs-var">args</span></a></span><span> </span><span class="annot"><span class="annottext">FVs
</span><a href="#local-6989586621680955226"><span class="hs-identifier hs-var">bounds</span></a></span><span> </span><span class="annot"><span class="annottext">[StgArg]
</span><a href="#local-6989586621680955224"><span class="hs-keyword hs-var">as</span></a></span><span>
</span><span id="line-66"></span><span>
</span><span id="line-67"></span><span>    </span><span class="annot"><a href="#local-6989586621680955222"><span class="hs-identifier hs-type">var</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Stg.DepAnal.html#BVs"><span class="hs-identifier hs-type">BVs</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#Var"><span class="hs-identifier hs-type">Var</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Stg.DepAnal.html#FVs"><span class="hs-identifier hs-type">FVs</span></a></span><span>
</span><span id="line-68"></span><span>    </span><span id="local-6989586621680955222"><span class="annot"><span class="annottext">var :: FVs -&gt; Id -&gt; FVs
</span><a href="#local-6989586621680955222"><span class="hs-identifier hs-var hs-var">var</span></a></span></span><span> </span><span id="local-6989586621680955220"><span class="annot"><span class="annottext">FVs
</span><a href="#local-6989586621680955220"><span class="hs-identifier hs-var">bounds</span></a></span></span><span> </span><span id="local-6989586621680955219"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680955219"><span class="hs-identifier hs-var">v</span></a></span></span><span>
</span><span id="line-69"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; FVs -&gt; Bool
</span><a href="GHC.Types.Var.Set.html#elemVarSet"><span class="hs-identifier hs-var">elemVarSet</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680955219"><span class="hs-identifier hs-var">v</span></a></span><span> </span><span class="annot"><span class="annottext">FVs
</span><a href="#local-6989586621680955220"><span class="hs-identifier hs-var">bounds</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-70"></span><span>      </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Module -&gt; Name -&gt; Bool
</span><a href="GHC.Types.Name.html#nameIsLocalOrFrom"><span class="hs-identifier hs-var">nameIsLocalOrFrom</span></a></span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621680955253"><span class="hs-identifier hs-var">this_mod</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; Name
</span><a href="GHC.Types.Id.html#idName"><span class="hs-identifier hs-var">idName</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680955219"><span class="hs-identifier hs-var">v</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-71"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Id -&gt; FVs
</span><a href="GHC.Types.Var.Set.html#unitVarSet"><span class="hs-identifier hs-var">unitVarSet</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680955219"><span class="hs-identifier hs-var">v</span></a></span><span>
</span><span id="line-72"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>
</span><span id="line-73"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FVs
</span><a href="GHC.Types.Var.Set.html#emptyVarSet"><span class="hs-identifier hs-var">emptyVarSet</span></a></span><span>
</span><span id="line-74"></span><span>
</span><span id="line-75"></span><span>    </span><span class="annot"><a href="#local-6989586621680955214"><span class="hs-identifier hs-type">arg</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Stg.DepAnal.html#BVs"><span class="hs-identifier hs-type">BVs</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Stg.Syntax.html#StgArg"><span class="hs-identifier hs-type">StgArg</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Stg.DepAnal.html#FVs"><span class="hs-identifier hs-type">FVs</span></a></span><span>
</span><span id="line-76"></span><span>    </span><span id="local-6989586621680955214"><span class="annot"><span class="annottext">arg :: FVs -&gt; StgArg -&gt; FVs
</span><a href="#local-6989586621680955214"><span class="hs-identifier hs-var hs-var">arg</span></a></span></span><span> </span><span id="local-6989586621680955213"><span class="annot"><span class="annottext">FVs
</span><a href="#local-6989586621680955213"><span class="hs-identifier hs-var">bounds</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Stg.Syntax.html#StgVarArg"><span class="hs-identifier hs-type">StgVarArg</span></a></span><span> </span><span id="local-6989586621680955211"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680955211"><span class="hs-identifier hs-var">v</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FVs -&gt; Id -&gt; FVs
</span><a href="#local-6989586621680955222"><span class="hs-identifier hs-var">var</span></a></span><span> </span><span class="annot"><span class="annottext">FVs
</span><a href="#local-6989586621680955213"><span class="hs-identifier hs-var">bounds</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680955211"><span class="hs-identifier hs-var">v</span></a></span><span>
</span><span id="line-77"></span><span>    </span><span class="annot"><a href="#local-6989586621680955214"><span class="hs-identifier hs-var">arg</span></a></span><span> </span><span class="annot"><span class="annottext">FVs
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><a href="GHC.Stg.Syntax.html#StgLitArg"><span class="hs-identifier hs-type">StgLitArg</span></a></span><span class="hs-special">{</span><span class="hs-special">}</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FVs
</span><a href="GHC.Types.Var.Set.html#emptyVarSet"><span class="hs-identifier hs-var">emptyVarSet</span></a></span><span>
</span><span id="line-78"></span><span>
</span><span id="line-79"></span><span>    </span><span class="annot"><a href="#local-6989586621680955223"><span class="hs-identifier hs-type">args</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Stg.DepAnal.html#BVs"><span class="hs-identifier hs-type">BVs</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Stg.Syntax.html#StgArg"><span class="hs-identifier hs-type">StgArg</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Stg.DepAnal.html#FVs"><span class="hs-identifier hs-type">FVs</span></a></span><span>
</span><span id="line-80"></span><span>    </span><span id="local-6989586621680955223"><span class="annot"><span class="annottext">args :: FVs -&gt; [StgArg] -&gt; FVs
</span><a href="#local-6989586621680955223"><span class="hs-identifier hs-var hs-var">args</span></a></span></span><span> </span><span id="local-6989586621680955209"><span class="annot"><span class="annottext">FVs
</span><a href="#local-6989586621680955209"><span class="hs-identifier hs-var">bounds</span></a></span></span><span> </span><span id="local-6989586621680955208"><span class="annot"><span class="annottext">[StgArg]
</span><a href="#local-6989586621680955208"><span class="hs-keyword hs-var">as</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[FVs] -&gt; FVs
</span><a href="GHC.Types.Var.Set.html#unionVarSets"><span class="hs-identifier hs-var">unionVarSets</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(StgArg -&gt; FVs) -&gt; [StgArg] -&gt; [FVs]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FVs -&gt; StgArg -&gt; FVs
</span><a href="#local-6989586621680955214"><span class="hs-identifier hs-var">arg</span></a></span><span> </span><span class="annot"><span class="annottext">FVs
</span><a href="#local-6989586621680955209"><span class="hs-identifier hs-var">bounds</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[StgArg]
</span><a href="#local-6989586621680955208"><span class="hs-keyword hs-var">as</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-81"></span><span>
</span><span id="line-82"></span><span>    </span><span class="annot"><a href="#local-6989586621680955227"><span class="hs-identifier hs-type">expr</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Stg.DepAnal.html#BVs"><span class="hs-identifier hs-type">BVs</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Stg.Syntax.html#StgExpr"><span class="hs-identifier hs-type">StgExpr</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Stg.DepAnal.html#FVs"><span class="hs-identifier hs-type">FVs</span></a></span><span>
</span><span id="line-83"></span><span>    </span><span id="local-6989586621680955227"><span class="annot"><span class="annottext">expr :: FVs -&gt; GenStgExpr 'Vanilla -&gt; FVs
</span><a href="#local-6989586621680955227"><span class="hs-identifier hs-var hs-var">expr</span></a></span></span><span> </span><span id="local-6989586621680955206"><span class="annot"><span class="annottext">FVs
</span><a href="#local-6989586621680955206"><span class="hs-identifier hs-var">bounds</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Stg.Syntax.html#StgApp"><span class="hs-identifier hs-type">StgApp</span></a></span><span> </span><span id="local-6989586621680955204"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680955204"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621680955203"><span class="annot"><span class="annottext">[StgArg]
</span><a href="#local-6989586621680955203"><span class="hs-keyword hs-var">as</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-84"></span><span>      </span><span class="annot"><span class="annottext">FVs -&gt; Id -&gt; FVs
</span><a href="#local-6989586621680955222"><span class="hs-identifier hs-var">var</span></a></span><span> </span><span class="annot"><span class="annottext">FVs
</span><a href="#local-6989586621680955206"><span class="hs-identifier hs-var">bounds</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680955204"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">FVs -&gt; FVs -&gt; FVs
</span><a href="GHC.Types.Var.Set.html#unionVarSet"><span class="hs-operator hs-var">`unionVarSet`</span></a></span><span> </span><span class="annot"><span class="annottext">FVs -&gt; [StgArg] -&gt; FVs
</span><a href="#local-6989586621680955223"><span class="hs-identifier hs-var">args</span></a></span><span> </span><span class="annot"><span class="annottext">FVs
</span><a href="#local-6989586621680955206"><span class="hs-identifier hs-var">bounds</span></a></span><span> </span><span class="annot"><span class="annottext">[StgArg]
</span><a href="#local-6989586621680955203"><span class="hs-keyword hs-var">as</span></a></span><span>
</span><span id="line-85"></span><span>
</span><span id="line-86"></span><span>    </span><span class="annot"><a href="#local-6989586621680955227"><span class="hs-identifier hs-var">expr</span></a></span><span> </span><span class="annot"><span class="annottext">FVs
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><a href="GHC.Stg.Syntax.html#StgLit"><span class="hs-identifier hs-type">StgLit</span></a></span><span class="hs-special">{</span><span class="hs-special">}</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-87"></span><span>      </span><span class="annot"><span class="annottext">FVs
</span><a href="GHC.Types.Var.Set.html#emptyVarSet"><span class="hs-identifier hs-var">emptyVarSet</span></a></span><span>
</span><span id="line-88"></span><span>
</span><span id="line-89"></span><span>    </span><span class="annot"><a href="#local-6989586621680955227"><span class="hs-identifier hs-var">expr</span></a></span><span> </span><span id="local-6989586621680955200"><span class="annot"><span class="annottext">FVs
</span><a href="#local-6989586621680955200"><span class="hs-identifier hs-var">bounds</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Stg.Syntax.html#StgConApp"><span class="hs-identifier hs-type">StgConApp</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621680955198"><span class="annot"><span class="annottext">[StgArg]
</span><a href="#local-6989586621680955198"><span class="hs-keyword hs-var">as</span></a></span></span><span> </span><span class="annot"><span class="annottext">[Type]
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-90"></span><span>      </span><span class="annot"><span class="annottext">FVs -&gt; [StgArg] -&gt; FVs
</span><a href="#local-6989586621680955223"><span class="hs-identifier hs-var">args</span></a></span><span> </span><span class="annot"><span class="annottext">FVs
</span><a href="#local-6989586621680955200"><span class="hs-identifier hs-var">bounds</span></a></span><span> </span><span class="annot"><span class="annottext">[StgArg]
</span><a href="#local-6989586621680955198"><span class="hs-keyword hs-var">as</span></a></span><span>
</span><span id="line-91"></span><span>    </span><span class="annot"><a href="#local-6989586621680955227"><span class="hs-identifier hs-var">expr</span></a></span><span> </span><span id="local-6989586621680955197"><span class="annot"><span class="annottext">FVs
</span><a href="#local-6989586621680955197"><span class="hs-identifier hs-var">bounds</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Stg.Syntax.html#StgOpApp"><span class="hs-identifier hs-type">StgOpApp</span></a></span><span> </span><span class="annot"><span class="annottext">StgOp
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621680955195"><span class="annot"><span class="annottext">[StgArg]
</span><a href="#local-6989586621680955195"><span class="hs-keyword hs-var">as</span></a></span></span><span> </span><span class="annot"><span class="annottext">Type
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-92"></span><span>      </span><span class="annot"><span class="annottext">FVs -&gt; [StgArg] -&gt; FVs
</span><a href="#local-6989586621680955223"><span class="hs-identifier hs-var">args</span></a></span><span> </span><span class="annot"><span class="annottext">FVs
</span><a href="#local-6989586621680955197"><span class="hs-identifier hs-var">bounds</span></a></span><span> </span><span class="annot"><span class="annottext">[StgArg]
</span><a href="#local-6989586621680955195"><span class="hs-keyword hs-var">as</span></a></span><span>
</span><span id="line-93"></span><span>    </span><span class="annot"><a href="#local-6989586621680955227"><span class="hs-identifier hs-var">expr</span></a></span><span> </span><span class="annot"><span class="annottext">FVs
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621680955194"><span class="annot"><span class="annottext">lam :: GenStgExpr 'Vanilla
</span><a href="#local-6989586621680955194"><span class="hs-identifier hs-var">lam</span></a></span></span><span class="hs-glyph">@</span><span class="annot"><a href="GHC.Stg.Syntax.html#StgLam"><span class="hs-identifier hs-type">StgLam</span></a></span><span class="hs-special">{</span><span class="hs-special">}</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-94"></span><span>      </span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; FVs
forall a. HasCallStack =&gt; String -&gt; SDoc -&gt; a
</span><a href="GHC.Utils.Outputable.html#pprPanic"><span class="hs-identifier hs-var">pprPanic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;annTopBindingsDeps&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Found lambda:&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span> </span><span class="annot"><span class="annottext">StgPprOpts -&gt; GenStgExpr 'Vanilla -&gt; SDoc
forall (pass :: StgPass).
OutputablePass pass =&gt;
StgPprOpts -&gt; GenStgExpr pass -&gt; SDoc
</span><a href="GHC.Stg.Syntax.html#pprStgExpr"><span class="hs-identifier hs-var">pprStgExpr</span></a></span><span> </span><span class="annot"><span class="annottext">StgPprOpts
</span><a href="GHC.Stg.Syntax.html#panicStgPprOpts"><span class="hs-identifier hs-var">panicStgPprOpts</span></a></span><span> </span><span class="annot"><span class="annottext">GenStgExpr 'Vanilla
</span><a href="#local-6989586621680955194"><span class="hs-identifier hs-var">lam</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-95"></span><span>    </span><span class="annot"><a href="#local-6989586621680955227"><span class="hs-identifier hs-var">expr</span></a></span><span> </span><span id="local-6989586621680955187"><span class="annot"><span class="annottext">FVs
</span><a href="#local-6989586621680955187"><span class="hs-identifier hs-var">bounds</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Stg.Syntax.html#StgCase"><span class="hs-identifier hs-type">StgCase</span></a></span><span> </span><span id="local-6989586621680955185"><span class="annot"><span class="annottext">GenStgExpr 'Vanilla
</span><a href="#local-6989586621680955185"><span class="hs-identifier hs-var">scrut</span></a></span></span><span> </span><span id="local-6989586621680955184"><span class="annot"><span class="annottext">BinderP 'Vanilla
</span><a href="#local-6989586621680955184"><span class="hs-identifier hs-var">scrut_bndr</span></a></span></span><span> </span><span class="annot"><span class="annottext">AltType
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621680955183"><span class="annot"><span class="annottext">[GenStgAlt 'Vanilla]
</span><a href="#local-6989586621680955183"><span class="hs-keyword hs-var">as</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-96"></span><span>      </span><span class="annot"><span class="annottext">FVs -&gt; GenStgExpr 'Vanilla -&gt; FVs
</span><a href="#local-6989586621680955227"><span class="hs-identifier hs-var">expr</span></a></span><span> </span><span class="annot"><span class="annottext">FVs
</span><a href="#local-6989586621680955187"><span class="hs-identifier hs-var">bounds</span></a></span><span> </span><span class="annot"><span class="annottext">GenStgExpr 'Vanilla
</span><a href="#local-6989586621680955185"><span class="hs-identifier hs-var">scrut</span></a></span><span> </span><span class="annot"><span class="annottext">FVs -&gt; FVs -&gt; FVs
</span><a href="GHC.Types.Var.Set.html#unionVarSet"><span class="hs-operator hs-var">`unionVarSet`</span></a></span><span>
</span><span id="line-97"></span><span>        </span><span class="annot"><span class="annottext">FVs -&gt; [GenStgAlt 'Vanilla] -&gt; FVs
</span><a href="#local-6989586621680955182"><span class="hs-identifier hs-var">alts</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FVs -&gt; Id -&gt; FVs
</span><a href="GHC.Types.Var.Set.html#extendVarSet"><span class="hs-identifier hs-var">extendVarSet</span></a></span><span> </span><span class="annot"><span class="annottext">FVs
</span><a href="#local-6989586621680955187"><span class="hs-identifier hs-var">bounds</span></a></span><span> </span><span class="annot"><span class="annottext">Id
BinderP 'Vanilla
</span><a href="#local-6989586621680955184"><span class="hs-identifier hs-var">scrut_bndr</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[GenStgAlt 'Vanilla]
</span><a href="#local-6989586621680955183"><span class="hs-keyword hs-var">as</span></a></span><span>
</span><span id="line-98"></span><span>    </span><span class="annot"><a href="#local-6989586621680955227"><span class="hs-identifier hs-var">expr</span></a></span><span> </span><span id="local-6989586621680955180"><span class="annot"><span class="annottext">FVs
</span><a href="#local-6989586621680955180"><span class="hs-identifier hs-var">bounds</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Stg.Syntax.html#StgLet"><span class="hs-identifier hs-type">StgLet</span></a></span><span> </span><span class="annot"><span class="annottext">XLet 'Vanilla
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621680955178"><span class="annot"><span class="annottext">GenStgBinding 'Vanilla
</span><a href="#local-6989586621680955178"><span class="hs-identifier hs-var">bs</span></a></span></span><span> </span><span id="local-6989586621680955177"><span class="annot"><span class="annottext">GenStgExpr 'Vanilla
</span><a href="#local-6989586621680955177"><span class="hs-identifier hs-var">e</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-99"></span><span>      </span><span class="annot"><span class="annottext">FVs -&gt; GenStgBinding 'Vanilla -&gt; FVs
</span><a href="#local-6989586621680955246"><span class="hs-identifier hs-var">binding</span></a></span><span> </span><span class="annot"><span class="annottext">FVs
</span><a href="#local-6989586621680955180"><span class="hs-identifier hs-var">bounds</span></a></span><span> </span><span class="annot"><span class="annottext">GenStgBinding 'Vanilla
</span><a href="#local-6989586621680955178"><span class="hs-identifier hs-var">bs</span></a></span><span> </span><span class="annot"><span class="annottext">FVs -&gt; FVs -&gt; FVs
</span><a href="GHC.Types.Var.Set.html#unionVarSet"><span class="hs-operator hs-var">`unionVarSet`</span></a></span><span>
</span><span id="line-100"></span><span>        </span><span class="annot"><span class="annottext">FVs -&gt; GenStgExpr 'Vanilla -&gt; FVs
</span><a href="#local-6989586621680955227"><span class="hs-identifier hs-var">expr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FVs -&gt; [Id] -&gt; FVs
</span><a href="GHC.Types.Var.Set.html#extendVarSetList"><span class="hs-identifier hs-var">extendVarSetList</span></a></span><span> </span><span class="annot"><span class="annottext">FVs
</span><a href="#local-6989586621680955180"><span class="hs-identifier hs-var">bounds</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">GenStgBinding 'Vanilla -&gt; [Id]
forall (a :: StgPass). (BinderP a ~ Id) =&gt; GenStgBinding a -&gt; [Id]
</span><a href="GHC.Stg.Syntax.html#bindersOf"><span class="hs-identifier hs-var">bindersOf</span></a></span><span> </span><span class="annot"><span class="annottext">GenStgBinding 'Vanilla
</span><a href="#local-6989586621680955178"><span class="hs-identifier hs-var">bs</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">GenStgExpr 'Vanilla
</span><a href="#local-6989586621680955177"><span class="hs-identifier hs-var">e</span></a></span><span>
</span><span id="line-101"></span><span>    </span><span class="annot"><a href="#local-6989586621680955227"><span class="hs-identifier hs-var">expr</span></a></span><span> </span><span id="local-6989586621680955175"><span class="annot"><span class="annottext">FVs
</span><a href="#local-6989586621680955175"><span class="hs-identifier hs-var">bounds</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Stg.Syntax.html#StgLetNoEscape"><span class="hs-identifier hs-type">StgLetNoEscape</span></a></span><span> </span><span class="annot"><span class="annottext">XLetNoEscape 'Vanilla
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621680955173"><span class="annot"><span class="annottext">GenStgBinding 'Vanilla
</span><a href="#local-6989586621680955173"><span class="hs-identifier hs-var">bs</span></a></span></span><span> </span><span id="local-6989586621680955172"><span class="annot"><span class="annottext">GenStgExpr 'Vanilla
</span><a href="#local-6989586621680955172"><span class="hs-identifier hs-var">e</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-102"></span><span>      </span><span class="annot"><span class="annottext">FVs -&gt; GenStgBinding 'Vanilla -&gt; FVs
</span><a href="#local-6989586621680955246"><span class="hs-identifier hs-var">binding</span></a></span><span> </span><span class="annot"><span class="annottext">FVs
</span><a href="#local-6989586621680955175"><span class="hs-identifier hs-var">bounds</span></a></span><span> </span><span class="annot"><span class="annottext">GenStgBinding 'Vanilla
</span><a href="#local-6989586621680955173"><span class="hs-identifier hs-var">bs</span></a></span><span> </span><span class="annot"><span class="annottext">FVs -&gt; FVs -&gt; FVs
</span><a href="GHC.Types.Var.Set.html#unionVarSet"><span class="hs-operator hs-var">`unionVarSet`</span></a></span><span>
</span><span id="line-103"></span><span>        </span><span class="annot"><span class="annottext">FVs -&gt; GenStgExpr 'Vanilla -&gt; FVs
</span><a href="#local-6989586621680955227"><span class="hs-identifier hs-var">expr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FVs -&gt; [Id] -&gt; FVs
</span><a href="GHC.Types.Var.Set.html#extendVarSetList"><span class="hs-identifier hs-var">extendVarSetList</span></a></span><span> </span><span class="annot"><span class="annottext">FVs
</span><a href="#local-6989586621680955175"><span class="hs-identifier hs-var">bounds</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">GenStgBinding 'Vanilla -&gt; [Id]
forall (a :: StgPass). (BinderP a ~ Id) =&gt; GenStgBinding a -&gt; [Id]
</span><a href="GHC.Stg.Syntax.html#bindersOf"><span class="hs-identifier hs-var">bindersOf</span></a></span><span> </span><span class="annot"><span class="annottext">GenStgBinding 'Vanilla
</span><a href="#local-6989586621680955173"><span class="hs-identifier hs-var">bs</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">GenStgExpr 'Vanilla
</span><a href="#local-6989586621680955172"><span class="hs-identifier hs-var">e</span></a></span><span>
</span><span id="line-104"></span><span>
</span><span id="line-105"></span><span>    </span><span class="annot"><a href="#local-6989586621680955227"><span class="hs-identifier hs-var">expr</span></a></span><span> </span><span id="local-6989586621680955171"><span class="annot"><span class="annottext">FVs
</span><a href="#local-6989586621680955171"><span class="hs-identifier hs-var">bounds</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Stg.Syntax.html#StgTick"><span class="hs-identifier hs-type">StgTick</span></a></span><span> </span><span class="annot"><span class="annottext">Tickish Id
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621680955169"><span class="annot"><span class="annottext">GenStgExpr 'Vanilla
</span><a href="#local-6989586621680955169"><span class="hs-identifier hs-var">e</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-106"></span><span>      </span><span class="annot"><span class="annottext">FVs -&gt; GenStgExpr 'Vanilla -&gt; FVs
</span><a href="#local-6989586621680955227"><span class="hs-identifier hs-var">expr</span></a></span><span> </span><span class="annot"><span class="annottext">FVs
</span><a href="#local-6989586621680955171"><span class="hs-identifier hs-var">bounds</span></a></span><span> </span><span class="annot"><span class="annottext">GenStgExpr 'Vanilla
</span><a href="#local-6989586621680955169"><span class="hs-identifier hs-var">e</span></a></span><span>
</span><span id="line-107"></span><span>
</span><span id="line-108"></span><span>    </span><span class="annot"><a href="#local-6989586621680955182"><span class="hs-identifier hs-type">alts</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Stg.DepAnal.html#BVs"><span class="hs-identifier hs-type">BVs</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Stg.Syntax.html#StgAlt"><span class="hs-identifier hs-type">StgAlt</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Stg.DepAnal.html#FVs"><span class="hs-identifier hs-type">FVs</span></a></span><span>
</span><span id="line-109"></span><span>    </span><span id="local-6989586621680955182"><span class="annot"><span class="annottext">alts :: FVs -&gt; [GenStgAlt 'Vanilla] -&gt; FVs
</span><a href="#local-6989586621680955182"><span class="hs-identifier hs-var hs-var">alts</span></a></span></span><span> </span><span id="local-6989586621680955167"><span class="annot"><span class="annottext">FVs
</span><a href="#local-6989586621680955167"><span class="hs-identifier hs-var">bounds</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[FVs] -&gt; FVs
</span><a href="GHC.Types.Var.Set.html#unionVarSets"><span class="hs-identifier hs-var">unionVarSets</span></a></span><span> </span><span class="annot"><span class="annottext">([FVs] -&gt; FVs)
-&gt; ([(AltCon, [Id], GenStgExpr 'Vanilla)] -&gt; [FVs])
-&gt; [(AltCon, [Id], GenStgExpr 'Vanilla)]
-&gt; FVs
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">((AltCon, [Id], GenStgExpr 'Vanilla) -&gt; FVs)
-&gt; [(AltCon, [Id], GenStgExpr 'Vanilla)] -&gt; [FVs]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FVs -&gt; GenStgAlt 'Vanilla -&gt; FVs
</span><a href="#local-6989586621680955165"><span class="hs-identifier hs-var">alt</span></a></span><span> </span><span class="annot"><span class="annottext">FVs
</span><a href="#local-6989586621680955167"><span class="hs-identifier hs-var">bounds</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-110"></span><span>
</span><span id="line-111"></span><span>    </span><span class="annot"><a href="#local-6989586621680955165"><span class="hs-identifier hs-type">alt</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Stg.DepAnal.html#BVs"><span class="hs-identifier hs-type">BVs</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Stg.Syntax.html#StgAlt"><span class="hs-identifier hs-type">StgAlt</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Stg.DepAnal.html#FVs"><span class="hs-identifier hs-type">FVs</span></a></span><span>
</span><span id="line-112"></span><span>    </span><span id="local-6989586621680955165"><span class="annot"><span class="annottext">alt :: FVs -&gt; GenStgAlt 'Vanilla -&gt; FVs
</span><a href="#local-6989586621680955165"><span class="hs-identifier hs-var hs-var">alt</span></a></span></span><span> </span><span id="local-6989586621680955164"><span class="annot"><span class="annottext">FVs
</span><a href="#local-6989586621680955164"><span class="hs-identifier hs-var">bounds</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">AltCon
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680955163"><span class="annot"><span class="annottext">[BinderP 'Vanilla]
</span><a href="#local-6989586621680955163"><span class="hs-identifier hs-var">bndrs</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680955162"><span class="annot"><span class="annottext">GenStgExpr 'Vanilla
</span><a href="#local-6989586621680955162"><span class="hs-identifier hs-var">e</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-113"></span><span>      </span><span class="annot"><span class="annottext">FVs -&gt; GenStgExpr 'Vanilla -&gt; FVs
</span><a href="#local-6989586621680955227"><span class="hs-identifier hs-var">expr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FVs -&gt; [Id] -&gt; FVs
</span><a href="GHC.Types.Var.Set.html#extendVarSetList"><span class="hs-identifier hs-var">extendVarSetList</span></a></span><span> </span><span class="annot"><span class="annottext">FVs
</span><a href="#local-6989586621680955164"><span class="hs-identifier hs-var">bounds</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
[BinderP 'Vanilla]
</span><a href="#local-6989586621680955163"><span class="hs-identifier hs-var">bndrs</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">GenStgExpr 'Vanilla
</span><a href="#local-6989586621680955162"><span class="hs-identifier hs-var">e</span></a></span><span>
</span><span id="line-114"></span><span>
</span><span id="line-115"></span><span class="hs-comment">--------------------------------------------------------------------------------</span><span>
</span><span id="line-116"></span><span class="hs-comment">-- * Dependency sorting</span><span>
</span><span id="line-117"></span><span>
</span><span id="line-118"></span><span class="hs-comment">-- | Dependency sort a STG program so that dependencies come before uses.</span><span>
</span><span id="line-119"></span><span class="annot"><a href="GHC.Stg.DepAnal.html#depSortStgPgm"><span class="hs-identifier hs-type">depSortStgPgm</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Unit.Types.html#Module"><span class="hs-identifier hs-type">Module</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Stg.Syntax.html#StgTopBinding"><span class="hs-identifier hs-type">StgTopBinding</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Stg.Syntax.html#StgTopBinding"><span class="hs-identifier hs-type">StgTopBinding</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-120"></span><span id="depSortStgPgm"><span class="annot"><span class="annottext">depSortStgPgm :: Module -&gt; [StgTopBinding] -&gt; [StgTopBinding]
</span><a href="GHC.Stg.DepAnal.html#depSortStgPgm"><span class="hs-identifier hs-var hs-var">depSortStgPgm</span></a></span></span><span> </span><span id="local-6989586621680955161"><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621680955161"><span class="hs-identifier hs-var">this_mod</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-121"></span><span>    </span><span class="hs-pragma">{-# SCC</span><span> </span><span class="hs-pragma">&quot;STG.depSort&quot;</span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-122"></span><span>    </span><span class="annot"><span class="annottext">((StgTopBinding, FVs) -&gt; StgTopBinding)
-&gt; [(StgTopBinding, FVs)] -&gt; [StgTopBinding]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">(StgTopBinding, FVs) -&gt; StgTopBinding
forall a b. (a, b) -&gt; a
</span><a href="../../base/src/Data.Tuple.html#fst"><span class="hs-identifier hs-var">fst</span></a></span><span> </span><span class="annot"><span class="annottext">([(StgTopBinding, FVs)] -&gt; [StgTopBinding])
-&gt; ([StgTopBinding] -&gt; [(StgTopBinding, FVs)])
-&gt; [StgTopBinding]
-&gt; [StgTopBinding]
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">[(StgTopBinding, FVs)] -&gt; [(StgTopBinding, FVs)]
</span><a href="GHC.Stg.DepAnal.html#depSort"><span class="hs-identifier hs-var">depSort</span></a></span><span> </span><span class="annot"><span class="annottext">([(StgTopBinding, FVs)] -&gt; [(StgTopBinding, FVs)])
-&gt; ([StgTopBinding] -&gt; [(StgTopBinding, FVs)])
-&gt; [StgTopBinding]
-&gt; [(StgTopBinding, FVs)]
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Module -&gt; [StgTopBinding] -&gt; [(StgTopBinding, FVs)]
</span><a href="GHC.Stg.DepAnal.html#annTopBindingsDeps"><span class="hs-identifier hs-var">annTopBindingsDeps</span></a></span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621680955161"><span class="hs-identifier hs-var">this_mod</span></a></span><span>
</span><span id="line-123"></span><span>
</span><span id="line-124"></span><span class="hs-comment">-- | Sort free-variable-annotated STG bindings so that dependencies come before</span><span>
</span><span id="line-125"></span><span class="hs-comment">-- uses.</span><span>
</span><span id="line-126"></span><span class="annot"><a href="GHC.Stg.DepAnal.html#depSort"><span class="hs-identifier hs-type">depSort</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Stg.Syntax.html#StgTopBinding"><span class="hs-identifier hs-type">StgTopBinding</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Stg.DepAnal.html#FVs"><span class="hs-identifier hs-type">FVs</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Stg.Syntax.html#StgTopBinding"><span class="hs-identifier hs-type">StgTopBinding</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Stg.DepAnal.html#FVs"><span class="hs-identifier hs-type">FVs</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-127"></span><span id="depSort"><span class="annot"><span class="annottext">depSort :: [(StgTopBinding, FVs)] -&gt; [(StgTopBinding, FVs)]
</span><a href="GHC.Stg.DepAnal.html#depSort"><span class="hs-identifier hs-var hs-var">depSort</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(SCC (StgTopBinding, FVs) -&gt; [(StgTopBinding, FVs)])
-&gt; [SCC (StgTopBinding, FVs)] -&gt; [(StgTopBinding, FVs)]
forall (t :: * -&gt; *) a b. Foldable t =&gt; (a -&gt; [b]) -&gt; t a -&gt; [b]
</span><a href="../../base/src/Data.Foldable.html#concatMap"><span class="hs-identifier hs-var">concatMap</span></a></span><span> </span><span class="annot"><span class="annottext">SCC (StgTopBinding, FVs) -&gt; [(StgTopBinding, FVs)]
forall {p :: * -&gt; * -&gt; *} {c}.
(Outputable (p SDoc c), Bifunctor p) =&gt;
SCC (p StgTopBinding c) -&gt; [p StgTopBinding c]
</span><a href="#local-6989586621680955158"><span class="hs-identifier hs-var">get_binds</span></a></span><span> </span><span class="annot"><span class="annottext">([SCC (StgTopBinding, FVs)] -&gt; [(StgTopBinding, FVs)])
-&gt; ([(StgTopBinding, FVs)] -&gt; [SCC (StgTopBinding, FVs)])
-&gt; [(StgTopBinding, FVs)]
-&gt; [(StgTopBinding, FVs)]
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">((StgTopBinding, FVs) -&gt; [Name])
-&gt; ((StgTopBinding, FVs) -&gt; [Name])
-&gt; [(StgTopBinding, FVs)]
-&gt; [SCC (StgTopBinding, FVs)]
forall node.
(node -&gt; [Name]) -&gt; (node -&gt; [Name]) -&gt; [node] -&gt; [SCC node]
</span><a href="GHC.Types.Name.Env.html#depAnal"><span class="hs-identifier hs-var">depAnal</span></a></span><span> </span><span class="annot"><span class="annottext">(StgTopBinding, FVs) -&gt; [Name]
</span><a href="#local-6989586621680955156"><span class="hs-identifier hs-var">defs</span></a></span><span> </span><span class="annot"><span class="annottext">(StgTopBinding, FVs) -&gt; [Name]
</span><a href="#local-6989586621680955155"><span class="hs-identifier hs-var">uses</span></a></span><span>
</span><span id="line-128"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-129"></span><span>    </span><span class="annot"><a href="#local-6989586621680955155"><span class="hs-identifier hs-type">uses</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621680955156"><span class="hs-identifier hs-type">defs</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Stg.Syntax.html#StgTopBinding"><span class="hs-identifier hs-type">StgTopBinding</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Stg.DepAnal.html#FVs"><span class="hs-identifier hs-type">FVs</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-130"></span><span>
</span><span id="line-131"></span><span>    </span><span class="hs-comment">-- TODO (osa): I'm unhappy about two things in this code:</span><span>
</span><span id="line-132"></span><span>    </span><span class="hs-comment">--</span><span>
</span><span id="line-133"></span><span>    </span><span class="hs-comment">--     * Why do we need Name instead of Id for uses and dependencies?</span><span>
</span><span id="line-134"></span><span>    </span><span class="hs-comment">--     * Why do we need a [Name] instead of `Set Name`? Surely depAnal</span><span>
</span><span id="line-135"></span><span>    </span><span class="hs-comment">--       doesn't need any ordering.</span><span>
</span><span id="line-136"></span><span>
</span><span id="line-137"></span><span>    </span><span id="local-6989586621680955155"><span class="annot"><span class="annottext">uses :: (StgTopBinding, FVs) -&gt; [Name]
</span><a href="#local-6989586621680955155"><span class="hs-identifier hs-var hs-var">uses</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Stg.Syntax.html#StgTopStringLit"><span class="hs-identifier hs-type">StgTopStringLit</span></a></span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">FVs
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-138"></span><span>    </span><span class="annot"><a href="#local-6989586621680955155"><span class="hs-identifier hs-var">uses</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Stg.Syntax.html#StgTopLifted"><span class="hs-identifier hs-type">StgTopLifted</span></a></span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">,</span><span> </span><span id="local-6989586621680955154"><span class="annot"><span class="annottext">FVs
</span><a href="#local-6989586621680955154"><span class="hs-identifier hs-var">fvs</span></a></span></span><span class="hs-special">)</span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Id -&gt; Name) -&gt; [Id] -&gt; [Name]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">Id -&gt; Name
</span><a href="GHC.Types.Id.html#idName"><span class="hs-identifier hs-var">idName</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FVs -&gt; [Id]
forall elt. UniqSet elt -&gt; [elt]
</span><a href="GHC.Types.Unique.Set.html#nonDetEltsUniqSet"><span class="hs-identifier hs-var">nonDetEltsUniqSet</span></a></span><span> </span><span class="annot"><span class="annottext">FVs
</span><a href="#local-6989586621680955154"><span class="hs-identifier hs-var">fvs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-139"></span><span>
</span><span id="line-140"></span><span>    </span><span id="local-6989586621680955156"><span class="annot"><span class="annottext">defs :: (StgTopBinding, FVs) -&gt; [Name]
</span><a href="#local-6989586621680955156"><span class="hs-identifier hs-var hs-var">defs</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621680955153"><span class="annot"><span class="annottext">StgTopBinding
</span><a href="#local-6989586621680955153"><span class="hs-identifier hs-var">bind</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">FVs
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Id -&gt; Name) -&gt; [Id] -&gt; [Name]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">Id -&gt; Name
</span><a href="GHC.Types.Id.html#idName"><span class="hs-identifier hs-var">idName</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">StgTopBinding -&gt; [Id]
forall (a :: StgPass).
(BinderP a ~ Id) =&gt;
GenStgTopBinding a -&gt; [Id]
</span><a href="GHC.Stg.Syntax.html#bindersOfTop"><span class="hs-identifier hs-var">bindersOfTop</span></a></span><span> </span><span class="annot"><span class="annottext">StgTopBinding
</span><a href="#local-6989586621680955153"><span class="hs-identifier hs-var">bind</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-141"></span><span>
</span><span id="line-142"></span><span>    </span><span id="local-6989586621680955158"><span class="annot"><span class="annottext">get_binds :: SCC (p StgTopBinding c) -&gt; [p StgTopBinding c]
</span><a href="#local-6989586621680955158"><span class="hs-identifier hs-var hs-var">get_binds</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../containers/src/Data.Graph.html#AcyclicSCC"><span class="hs-identifier hs-type">AcyclicSCC</span></a></span><span> </span><span id="local-6989586621680955142"><span class="annot"><span class="annottext">p StgTopBinding c
</span><a href="#local-6989586621680955142"><span class="hs-identifier hs-var">bind</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-143"></span><span>      </span><span class="hs-special">[</span><span class="annot"><span class="annottext">p StgTopBinding c
</span><a href="#local-6989586621680955142"><span class="hs-identifier hs-var">bind</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-144"></span><span>    </span><span class="annot"><a href="#local-6989586621680955158"><span class="hs-identifier hs-var">get_binds</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../containers/src/Data.Graph.html#CyclicSCC"><span class="hs-identifier hs-type">CyclicSCC</span></a></span><span> </span><span id="local-6989586621680955140"><span class="annot"><span class="annottext">[p StgTopBinding c]
</span><a href="#local-6989586621680955140"><span class="hs-identifier hs-var">binds</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-145"></span><span>      </span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; [p StgTopBinding c]
forall a. HasCallStack =&gt; String -&gt; SDoc -&gt; a
</span><a href="GHC.Utils.Outputable.html#pprPanic"><span class="hs-identifier hs-var">pprPanic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;depSortStgBinds&quot;</span></span><span>
</span><span id="line-146"></span><span>               </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Found cyclic SCC:&quot;</span></span><span>
</span><span id="line-147"></span><span>               </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span> </span><span class="annot"><span class="annottext">[p SDoc c] -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(p StgTopBinding c -&gt; p SDoc c)
-&gt; [p StgTopBinding c] -&gt; [p SDoc c]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(StgTopBinding -&gt; SDoc) -&gt; p StgTopBinding c -&gt; p SDoc c
forall (p :: * -&gt; * -&gt; *) a b c.
Bifunctor p =&gt;
(a -&gt; b) -&gt; p a c -&gt; p b c
</span><a href="../../base/src/Data.Bifunctor.html#first"><span class="hs-identifier hs-var">first</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">StgPprOpts -&gt; StgTopBinding -&gt; SDoc
</span><a href="GHC.Stg.Syntax.html#pprStgTopBinding"><span class="hs-identifier hs-var">pprStgTopBinding</span></a></span><span> </span><span class="annot"><span class="annottext">StgPprOpts
</span><a href="GHC.Stg.Syntax.html#panicStgPprOpts"><span class="hs-identifier hs-var">panicStgPprOpts</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[p StgTopBinding c]
</span><a href="#local-6989586621680955140"><span class="hs-identifier hs-var">binds</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-148"></span></pre></body></html>